﻿@model ProductReviewOverviewModel
@using Nop.Web.Models.Catalog;

@if (Model.RatingSum > 0 && Model.TotalReviews > 0)
{
    decimal ratePercent = (100 * Model.RatingSum) / (Model.TotalReviews * 5);

        <div class="stars-info">
            <span class="stars-bottom">
                <i class="fa fa-star-o"></i>
                <i class="fa fa-star-o"></i>
                <i class="fa fa-star-o"></i>
                <i class="fa fa-star-o"></i>
                <i class="fa fa-star-o"></i>
            </span>
            <span class="stars-top" style="width:@(ratePercent)%">
                <i class="fa fa-star"></i>
                <i class="fa fa-star"></i>
                <i class="fa fa-star"></i>
                <i class="fa fa-star"></i>
                <i class="fa fa-star"></i>
            </span>
            <span class="stars-count"> (@Model.TotalReviews)</span>
        </div>
}
else if (Model.AllowCustomerReviews){
    <a class="first-reviewer" href="@Url.RouteUrl("ProductReviews", new { productId = Model.ProductId })">
        @T("Reviews.Overview.First")
    </a>
}